package com.helehousekeeping.radiobuttonproject.base;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

import com.helehousekeeping.radiobuttonproject.manager.ActivityCollector;

import butterknife.ButterKnife;

/**
 * @创建者 Jimven
 * @创建时间 2018/1/16/0016  9:58
 */
public abstract class BaseActivity extends AppCompatActivity {
    private Context mContext;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(setLayout());
        ButterKnife.bind(this);
        mContext = this;
        setView();
        ActivityCollector.addActivity(this);
    }

    abstract protected int setLayout();

    abstract protected void setView();

    @Override
    protected void onDestroy() {
        super.onDestroy();
        ButterKnife.unbind(this);
        ActivityCollector.removeActivity(this);
    }
}
